import { allArticleReq } from '@/utils/request'
import { ALLBLOGCHANGE, BREADLIST } from '@/store/actionType'

export default {
  getAllArticle: () => {
    return allArticleReq().then(res => {
      const payload = res.result && res.result.length > 0 ? res.result : []
      return {
        type: ALLBLOGCHANGE,
        payload
      }
    })
  },
  setBreadList: (payload) => {
    return ({
      type: BREADLIST,
      payload
    })
  }
}